define(["component/base/normalThings","component/textbox/avalon.textbox","component/spinner/avalon.spinner","component/dropdowncheckbox/avalon.dropdowncheckbox","component/dialog/avalon.dialog","component/singledatepicker/avalon.singledatepicker","component/button/avalon.button","component/calendar/avalon.calendar","component/simpledropdownpager/avalon.simpledropdownpager"], function(){
    var fv = avalon.define({
        $id: "formview",
        $dropdownOpt1:{
            sourceFlag:{value:"id",text:"name"},
            dataSource:[{name:'购物',id:1},{name:'游轮',id:2},{name:'newone',id:3}]
            //,checkFunc:function(){
            //alert(123);
            //}
        },
        $dropdownOpt2:{
            width:"300px",
            dataSource:[{text:'请选择',value:0,check:true},{text:'合同类型1',value:1},{text:'合同类型2',value:2}]
        },
        datetool:function(){
            var ss = avalon.vmodels['sgr1'];
            ss._togglepicker();
        },
        $dailogMemorandum:{
            title:"添加备注",
            modal:false,
            width:"700"
            //draggable:true
        },
        show: function (id) {
            avalon.vmodels[id].toggle = true;
        },
        $calendar1:{
            textbox:{
                fronttitle:"开始日期:"
            },
            datepicker:{
                cpwidth:'276px',
                showpk:false,
                singleSelect:true,
                //checkedDates:['2016-4-22'],
                aftercheckfunc:function(arr){
                    console.log(arr[0]);
                }
            }
        },
        cityname:'',
        showdropdowncity:function(e){
            e.stopPropagation();
            avalon.vmodels['dropdowntest1'].dropdownshow = !avalon.vmodels['dropdowntest1'].dropdownshow;
        },
        $dropdowncfg:{
            pullDataFuncUrl:"../../component/simpledropdownpager/testDropdownjson.json",
            serverside:true,
            wgwidth:"300px",
            fuzzysourceflag:{name: "cName", value: "value"},
            fuzzyServerside:true,
            fuzzypullDataFuncUrl:"../../component/simpledropdownpager/testDropdownjson.json",
            showsize:3,
            sourceFlag:{name: "cName", value: "value"},
            outervmid:'formview',
            duplexValue:"cityname",
            optionClickFunc:function(obj){
                console.log(obj);
            }
        },
        radiovalue: "plane",
        checkboxcity:["shenzhen"],
        saveSub:function(){
            alert(fv);
        }
    });
    return fv;
})